/**
 * Created by ebi on 2017/6/19.
 */
import Mock from 'mockjs'
var Random = Mock.Random
/* eslint-disable */
Random.extend({
  label: function(date) {
      var labels = ['A', 'B', 'C', 'D']
      return this.pick(labels)
  },
  group: function(date) {
    var groups = ['小桌(1-2人)', '中桌(2-4人)', '大桌(4-8人)', '超大桌(8人以上)']
    return this.pick(groups)
  }
})
const login = Mock.mock({
  code: 0,
  msg: '',
  userMsg: '',
  data: {
    token: '@guid'
  }
})
const seatList = Mock.mock({
  code: 0,
  msg: '',
  userMsg: '',
  data: {
    'list|1-10': [{
      'id|+1': 1,
      'label': Random.label(),
      'group': Random.group(),
      'updateTime': Random.date('yyyy-MM-dd')
    }]
  }
})

const menu = Mock.mock({
  code: 0,
  msg: '',
  userMsg: '',
  data: {
    menu: [
      {
        id: 1,
        icon: 'fa-home',
        path: '/',
        name: '首页',
      },
      {
        id: 2,
        icon: 'fa-gear',
        path: '/store/list',
        name: '店铺设置',
      },
      {
        id: 3,
        icon: 'fa-puzzle-piece',
        path: '',
        name: '桌位管理',
        subs: [
          {
            id: 11,
            icon: 'fa-diamond',
            path: '/seat/category',
            name: '类型设置',
          },
          {
            id: 12,
            icon: 'fa-inbox',
            path: '/seat/table',
            name: '桌位设置',
          },
        ]
      },
      {
        id: 4,
        icon: 'fa-certificate',
        path: '/seat/set',
        name: '排座',
      }
    ]
  }
})

export default {
  login,
  seatList,
  menu
}
